home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 48 / Amiga Format CD48 (1999-12-13)(Future Publishing)(GB)(Track 1 of 2)[!][issue 2000-01].iso / -serious- / programming / c / stormamiga_lib / include / unistd.h < prev    next >
C/C++ Source or Header  |  1999-11-01  |  2KB  |  80 lines

  1. #ifndef UNISTD_H
  2. #define UNISTD_H
  3.  
  4. /*
  5. **          $VER: unistd.h 1.6 (18.09.98)
  6. **             Includes Release 45.00
  7. **
  8. **     Copyright © 1996/99 by CyberdyneSystems
  9. **
  10. **            written by Matthias Henze
  11. **               All Rights Reserved
  12. */
  13.  
  14. #ifndef STORMAMIGA_H
  15.   #include <stormamiga.h>
  16. #endif
  17. #ifndef SYS_TYPES_H
  18.   #include <sys/types.h>
  19. #endif
  20. #ifndef SYS_UNISTD_H
  21.   #include <sys/unistd.h>
  22. #endif
  23. #ifndef _INCLUDE_STDIO_H
  24.   #include <stdio.h>
  25. #endif
  26.  
  27. #ifdef __cplusplus
  28.   extern "C" {
  29. #endif
  30.  
  31. #define STDIN_FILENO    0       /* standard input file descriptor */
  32. #define STDOUT_FILENO   1       /* standard output file descriptor */
  33. #define STDERR_FILENO   2       /* standard error file descriptor */
  34.  
  35.  
  36. /*----- ANSI C-functions -----*/
  37.  
  38. char    *getcwd (char *, size_t);
  39.  
  40. /*----- UNIX-functions -----*/
  41.  
  42. char    *getwd  (char *);
  43. char    *mktemp (char *);
  44. int     rmdir   (cchar *);
  45. void    sleep   (uint);
  46. int     unlink  (cchar *);
  47. void    usleep  (uint);
  48.  
  49.  
  50. /*----- POSIX-functions -----*/
  51.  
  52. int     access  (cchar *, int);
  53. int     chdir   (cchar *);
  54. int     close   (int);
  55. off_t   lseek   (int, off_t, int);
  56. ssize_t read    (int, void *, size_t);
  57. ssize_t write   (int, cvoid *, size_t);
  58.  
  59. #ifdef __cplusplus
  60.   }
  61. #endif
  62.  
  63. #ifdef STORMAMIGA_UNIXPATH
  64.   __inline int access_u (cchar *file, int mode)
  65.   { return access       (file, mode); }
  66.  
  67.   __inline int chdir_u  (cchar *path)
  68.   { return chdir        (path); }
  69.  
  70.   __inline int rmdir_u  (cchar *path)
  71.   { return rmdir        (path); }
  72.  
  73.   #define access(file, mode)  access_u(UnixToAmigaPath(file), mode)
  74.   #define chdir(path)         chdir_u(UnixToAmigaPath(path))
  75.   #define rmdir(path)         rmdir_u(UnixToAmigaPath(path))
  76.   #define unlink(path)        rmdir_u(UnixToAmigaPath(path))
  77. #endif
  78.  
  79. #endif /* UNISTD_H */
  80.